Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

Comments

Feature/support for database views#8

Merged
olibf merged 4 commits intomainfrom
feature/support-for-database-views
Dec 19, 2025
Merged

Feature/support for database views#8
olibf merged 4 commits intomainfrom
feature/support-for-database-views

Conversation

@olibf
Copy link
Owner

@olibf olibf commented Dec 19, 2025

Pull Request

Description

With this feature, you can export views too. they look similar to tables in the output

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Changes Made

  • Added an extractor for database views for SQL Server
  • Extended the formatter to display views in the output
  • Added a command line option to enable or disable the view definition output

Testing

  • All existing tests pass
  • New tests added for new functionality
  • Manually tested on [Windows/Sql Server]

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have updated the CHANGELOG.md with my changes
  • New and existing unit tests pass locally with my changes
  • I have checked my code follows hexagonal architecture principles
  • I have ensured proper separation between domain, application, and infrastructure layers

Screenshots (if applicable)

Add screenshots to help explain your changes.

Additional Notes

Add any other notes about the PR here.


Note

Adds MSSQL view extraction and formatted export (including optional SQL definitions), updates counts/logging, and introduces a CLI flag to exclude view definitions.

  • Infrastructure (MSSQL):
    • Add ExtractViewsAsync in MsSqlSchemaExtractor using sys.views + sys.sql_modules for full definitions; include view columns.
  • Domain:
    • Add View entity and extend DatabaseSchema with Views.
  • Formatter:
    • Enhance CustomTextFormatter to output VIEW sections with columns; optionally include DEFINITION via IncludeViewDefinitions.
  • CLI:
    • Add --exclude-view-definitions option; wire to formatter and help text.
  • Application:
    • Update SchemaExportResult to separate TableCount/ViewCount (derive ObjectCount); adjust SchemaExportService logging and return values.
  • Docs:
    • Update README.md and CHANGELOG.md to document view support and new options.

Written by Cursor Bugbot for commit fcd443f. This will update automatically on new commits. Configure here.

Oliver Brandford added 3 commits December 19, 2025 11:38
…ws, including extraction, export, and detailed metadata. Updated related classes and logging to accommodate views alongside tables.
… exclude view SQL definitions from output. Updated `CustomTextFormatter` to conditionally include view definitions based on new property.
…s for improved readability and consistency.
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

public int ObjectCount { get; init; }
public int TableCount { get; init; }
public int ViewCount { get; init; }
public int ObjectCount => TableCount + ViewCount;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Console message shows table+view count as table count

The ObjectCount property was changed to return TableCount + ViewCount, but the console output in Program.cs line 201 displays "Tables exported: {result.ObjectCount}". This causes the message to misleadingly report the combined table and view count while labeling it as just "Tables". The message text and the value displayed no longer match after this change.

Fix in Cursor Fix in Web

@olibf olibf merged commit 6d86ffe into main Dec 19, 2025
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant